<template>
	<view class="content">
		
		<view class="list" v-for="(item, index) in list" :key="index">
		<view class="item">
			<view class="l">
				<text class="txt">{{item.myDate}}</text></br>
			</view>
				<view class="r">
					<text class="num add">
						答对{{item.num}}题
					</text>
				</view>
		</view>
		</view>
		<view class="noMore" v-show="isNoMore">暂无更多数据...</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				isNoMore:false,
				page:1,
				list:[], 
			}
		},
		onShow() {
			this.list=[];
			this.getData(1);
		},
		methods:{
			getData(page){
				let opts = {
					url: 'myCorrentRecord/getCorrentDetail/'+page,
					method: 'get'
				};
				let param = {};
				this.tokenRequest(opts, param).then(res => {
					uni.hideLoading();
					let rData = res.data;
					if(rData.length ==0){
						uni.showToast({
							title: '暂无更多数据...',
							mask: true,
							icon: 'none',
							duration: 1500
						})
						this.isNoMore = true;
						return;
					}
					for (let i = 0; i < rData.length; i++) {
						this.list.push(rData[i]);
					}
				}, error => {})
			}
		},onReachBottom() {
			this.page++;
			this.getData(this.page);
		}
	} 
</script>

<style>
	.item{
		width: 670rpx;
		margin: 0 20rpx;
		background-color: #fff;
		padding: 20rpx;
		border-radius: 10rpx;
		margin-top: 15rpx;
		overflow: hidden;
	}
	image{
		width: 80rpx;
		height: 80rpx;
		vertical-align: middle;
	}
	.l{
		float: left;
		width: 500rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.time{
		font-size: 28rpx;
		color: #C0C0C0;
	}
	.r{
		float: right;
	}
	.num{
		font-size: 38rpx;
		font-weight: 700;
	}
	.minus{
		color: #4CD964;
	}
	.add{
		color: #DD524D;
	}
</style>